 <?php
  require_once('tpl/header.php');
?>
       <?php 
       connect();
                $sql1="select * from comments ";
                $result1=mysql_query($sql1);


                     ?>
                    <table class="table table-bordered">
                        <tr>
                            <th>序号</th>
                            <th>视频名称</th>                         
                            <th>评论内容</th>
                            <th>发表评论的时间</th>
                            <th>评论人</th>
                             <th>操作</th>
                        </tr>
                        <?php 
                while ($row1=mysql_fetch_assoc($result1)) {
                        
                         ?>
                          <tr>
                            <td><?php echo $row1["cid"];  ?></td>
                             <td><?php 
                                $vid=$row1["vid"];
                                $sql2="select videoname from videos where vid=$vid" ;
                                $result2=mysql_query($sql2);
                                $row2=mysql_fetch_assoc($result2);
                                echo $row2["videoname"];
                               ?></td>
                            <td><?php echo $row1["content"];  ?></td>
                            <td><?php echo $row1["cdate"];  ?></td>
                            <td><?php
                            $uid=$row1["uid"];
                             $sql2="select * from users where uid=$uid";
                             $result2=mysql_query($sql2);
                             $row2=mysql_fetch_assoc($result2);
                             echo $row2["uname"];
                              ?></td>
                               <td><a href="doCommentDelete.php?cid=<?php echo $row1["cid"]; ?> ">删除</a></td>
                        </tr>
                         <?php 
                           }
                          ?>
                       
                    </table>

   


<?php
  require_once('tpl/footer.php');
?>